import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ManagerFeesVO, ManagerFeesForm, ManagerFeesQuery } from '@/api/device/managerFees/types';

/**
 * 查询代理商费用记录(场地)列表
 * @param query
 * @returns {*}
 */

export const listManagerFees = (query?: ManagerFeesQuery): AxiosPromise<ManagerFeesVO[]> => {
  return request({
    url: '/device/managerFees/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询代理商费用记录(场地)详细
 * @param managerFeesId
 */
export const getManagerFees = (managerFeesId: string | number): AxiosPromise<ManagerFeesVO> => {
  return request({
    url: '/device/managerFees/' + managerFeesId,
    method: 'get'
  });
};

/**
 * 新增代理商费用记录(场地)
 * @param data
 */
export const addManagerFees = (data: ManagerFeesForm) => {
  return request({
    url: '/device/managerFees',
    method: 'post',
    data: data
  });
};

/**
 * 修改代理商费用记录(场地)
 * @param data
 */
export const updateManagerFees = (data: ManagerFeesForm) => {
  return request({
    url: '/device/managerFees',
    method: 'put',
    data: data
  });
};

/**
 * 删除代理商费用记录(场地)
 * @param managerFeesId
 */
export const delManagerFees = (managerFeesId: string | number | Array<string | number>) => {
  return request({
    url: '/device/managerFees/' + managerFeesId,
    method: 'delete'
  });
};
